package jfae.core.configuration;

import java.util.ArrayList;

import jfae.core.configuration.contributions.Contribution;
import jfae.core.configuration.contributions.Overriding;
import jfae.core.properties.FieldInfo;
import jfae.core.properties.parsers.ClassPropertyHandler;
import jfae.core.properties.parsers.FieldPropertyHandler;
import jfae.core.properties.parsers.PropertyHandler;
import jfae.core.properties.parsers.annotation.AnnotationHandler;
import jfae.core.properties.parsers.annotation.ColumnHandler;
import jfae.core.properties.parsers.annotation.EditableHandler;
import jfae.core.properties.parsers.annotation.NotNullHandler;
import jfae.core.properties.parsers.annotation.PresentationHandler;

public class CoreInitializer {

	public static void contributeAnnotationsHandlers(Contribution<AnnotationHandler<?>> contributions){
		contributions.add("columnHandler", new ColumnHandler());
		contributions.add("editableHandler", new EditableHandler());
		contributions.add("notNullHandler", new NotNullHandler());
		contributions.add("presentationHandler", new PresentationHandler());
	}
	
	public static void overrideAnnotationsHandlers(Overriding<AnnotationHandler<?>> contributions){

	}
	
	public static void contributePropertiesHandlers(Contribution<PropertyHandler<FieldInfo<?>>> contributions){
		contributions.add("fieldPropertyHandler", new FieldPropertyHandler(JFaeConfiguration.getAnnotationsHandlers()));
		contributions.add("classPropertyHandler", new ClassPropertyHandler(new ArrayList<AnnotationHandler<?>>()));
	}
	
	public static void overridePropertiesHandlers(Overriding<PropertyHandler<FieldInfo<?>>> contributions){
		
	}
	
}
